/*
 * @(#)StateSynServiceInfo.java   1.0  2021年11月17日
 * 
 * Copyright (c)	2014-2020. All Rights Reserved.	GuangZhou hhmk Technology Company LTD.
 */
package com.swift.dts.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.swift.core.auth.Login;
import com.swift.core.model.ServiceRequest;
import com.swift.core.model.data.DataModel;
import com.swift.core.model.data.MapDataModel;
import com.swift.core.service.SynInterface;
import com.swift.dts.dao.OfflineStateInfoDao;

/**
 * 查看同步任务进度
 * @author zhengjiajin
 * @version 1.0 2021年11月17日
 */
@Service("stateSynServiceInfo")
@Login
public class StateSynServiceInfo implements SynInterface{

    @Autowired
    private OfflineStateInfoDao offlineStateInfoDao;
    /** 
     * @see com.swift.core.service.SynInterface#doService(com.swift.core.model.ServiceRequest)
     */
    @Override
    public DataModel doService(ServiceRequest req) {
        DataModel res = new MapDataModel();
        String dataSource =req.getData().getString("data_source");
        String destination =req.getData().getString("destination");
        Integer state = req.getData().getInteger("state");
        res.addObject("list", offlineStateInfoDao.list(dataSource, destination, state));
        return res;
    }

}
